package com.hzlj.position.locate.controller;


import com.fz.common.base.dto.DeleteCommonDTO;
import com.fz.common.base.dto.PageParamDTO;
import com.fz.common.base.dto.QueryPageResultDTO;
import com.fz.common.base.dto.ResultDTO;
import com.hzlj.position.locate.common.dto.reportInitiativeSetting.ReportInitiativeSettingAddDTO;
import com.hzlj.position.locate.common.dto.reportInitiativeSetting.ReportInitiativeSettingQueryParamDTO;
import com.hzlj.position.locate.common.dto.reportInitiativeSetting.ReportInitiativeSettingQueryResultDTO;
import com.hzlj.position.locate.service.ReportInitiativeSettingService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 【通信联络核查-人脸签到-配置表】接口
 *
 * @author lifh
 * @date 2023-07-20 10:41:37
 */
@Slf4j
@RestController
@RequestMapping("/position/report/initiative/setting")
public class ReportInitiativeSettingController {

    @Resource
    private ReportInitiativeSettingService reportInitiativeSettingService;

    /**
     * 保存通信联络核查-人脸签到-配置表
     */
    @PutMapping("")
    public ResultDTO<ReportInitiativeSettingQueryResultDTO> saveReportInitiativeSetting(@Valid @RequestBody ReportInitiativeSettingAddDTO dto) {
        log.info("【新增信息】通信联络核查-人脸签到-配置表={}", dto);
        return new ResultDTO<>(reportInitiativeSettingService.saveReportInitiativeSetting(dto));
    }


    /**
     * 删除通信联络核查-人脸签到-配置表
     */
    @DeleteMapping(value = "")
    public ResultDTO<Boolean> deleteReportInitiativeSetting(@RequestBody DeleteCommonDTO<String> dto) {
        log.info("【删除信息】通信联络核查-人脸签到-配置表={}", dto);
        return new ResultDTO<>(reportInitiativeSettingService.deleteReportInitiativeSetting(dto));
    }

    /**
     * 分页查询 通信联络核查-人脸签到-配置表
     */
    @GetMapping("/list/page")
    public ResultDTO<QueryPageResultDTO<ReportInitiativeSettingQueryResultDTO>> pageReportInitiativeSetting(ReportInitiativeSettingQueryParamDTO dto, PageParamDTO pageParamDTO) {
        log.debug("【查询分页列表】信息通信联络核查-人脸签到-配置表,ReportInitiativeSettingQueryParamDTO={},pageParamDTO={}", dto, pageParamDTO);
        return new ResultDTO<>(reportInitiativeSettingService.pageReportInitiativeSetting(dto, pageParamDTO));
    }

}

